# -!- coding: utf-8 -!-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#作者：cacho_37967865
#博客：https://blog.csdn.net/sinat_37967865
#文件：deal_threading.py
#日期：2019-11-11
#备注：多线程处理的业务场景
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

import threading
import time


# 集合(列表信息)-->二维列表
def deal_list(list_info,func):
    threads = [threading.Thread(target=func, args=(data,)) for data in list_info]
    sTime = time.time()
    for t in threads:
        t.start()

    for t in threads:
        t.join()

    eTime = time.time()
    s = eTime - sTime
    print('多线程花费的时间为：%.2f秒' % (s))


def test(data):
    print(data)


if __name__ == '__main__':
    info = [1,2,3,4,5,6]
    deal_list(info, 2)